<div class="table-responsive">
    <div id="toolbar" class="toolbar">
        <a href="javascript:;" class="btn btn-primary" title="{:__('Refresh')}" onclick="location.reload();"><i class="fa fa-refresh"></i> </a>
    </div>
    <table class="table table-striped table-bordered table-hover table-nowrap" id="table">

    </table>
</div>
<!--@formatter:off-->
<script>
    require.callback = function () {
        define('backend/facrm/common', ['jquery', 'bootstrap', 'backend', 'table', 'template'], function ($, undefined, Backend, Table, Template) {
            var Controller = {
                pagelist: function () {
                    var table = $("#table");

                    // 初始化表格
                    table.bootstrapTable({
                        toolbar: ".toolbar", //工具栏
                        search: true, //是否启用快速搜索
                        cache: false,
                        pageSize: 10,
                        pagination: true,
                        pageList: [10, 15, 20, 25, 50, 'All'],
                        columns: [{
                            field: 'path',
                            title: '路径',
                            width:'40%',
                            formatter:function (value, row, index) {
                                return '<input type="text" class="form-control" value="' + value + '" />';
                            }
                        }, {
                            field: 'name',
                            title: '名称',
                            width:'45%',
                            align:'center',
                            valign: 'middle',
                        }, {
                            field: 'operate',
                            title: '操作',
                            align:'center',
                            width:'15%',
                            valign: 'middle',
                            formatter:function (value, row, index) {
                                return '<a href="javascript:" class="btn btn-success btn-xs btn-selectit">选择</a>';
                            }
                        }],
                        data: {$pageList|json_encode}
                    });

                    $(document).on("click", ".btn-selectit", function () {
                        Fast.api.close($(this).parent().prev().prev().find("input").val());
                        return false;
                    });

                }
            };
            return Controller;
        });
    }
</script>
<!--@formatter:on-->
